export default function(sequelize, DataTypes) {
  return sequelize.define('gupiao_update', {
    user_id: {
      type: DataTypes.STRING(25),
      allowNull: false,
      comment: "用户编号"
    },
    gupiao_id: {
      type: DataTypes.STRING(10),
      allowNull: false,
      comment: "股票编号"
    },
    before_buy: {
      type: DataTypes.FLOAT,
      allowNull: true,
      comment: "购买价格"
    },
    before_sell_high: {
      type: DataTypes.FLOAT,
      allowNull: true,
      comment: "高点卖出价格，默认为买入价格110%"
    },
    before_sell_low: {
      type: DataTypes.FLOAT,
      allowNull: true,
      comment: "低点卖出价格，默认为买入价格80%"
    },
    update_time: {
      type: DataTypes.CHAR(13),
      allowNull: true,
      comment: "修改时间"
    }
  }, {
    sequelize,
    tableName: 'gupiao_update',
    timestamps: false,
    indexes: [
      {
        name: "search",
        using: "BTREE",
        fields: [
          { name: "user_id" },
          { name: "gupiao_id" },
        ]
      },
    ]
  });
};
